<%@page contentType="text/html;charset=utf-8"%>
<html>
	<title>课堂测试</title>
	<body>
		<center>
			<font color="blue" size="5"> <i><b>课堂测试，请先输入学号和密码…</b> </i> </font>
			<hr>
			<form action="check.jsp" method="post">
				<table border="1">
					<tr>
						<th bgcolor="yellow">
							学号
						</th>
						<td>
							<input type="text" size="12" name="id">
						</td>
					</tr>
					<tr>
						<th bgcolor="yellow">
							密码
						</th>
						<td>
							<input type="password" size="12" name="password">
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<input type="submit" value="测试开始">
						</td>
					</tr>
				</table>
			</form>
			<font color="red"><%
 	//根据错误类型,显示相应信息
 	String error = request.getParameter("errortype");//由get返回错误参数值
 	if (error != null) {
 		int errortype = Integer.parseInt(error);//转换成整数
 		switch (errortype)
 		{
 		case 1:
 			out.println("学号为空!!");
 			break;
 		case 2:
 			out.println("密码为空!!");
 			break;
 		default:
 		}
 	}
 %>
			</font>
		</center>
	</body>
</html>
